package com.pearadmin.pro.modules.courseManagement.controller;

import com.pearadmin.pro.common.aop.annotation.Log;
import com.pearadmin.pro.common.constant.ControllerConstant;
import com.pearadmin.pro.common.context.UserContext;
import com.pearadmin.pro.common.web.base.BaseController;
import com.pearadmin.pro.common.web.domain.Result;
import com.pearadmin.pro.modules.courseManagement.domin.ClassSchedule;
import com.pearadmin.pro.modules.courseManagement.service.ClassScheduleService;
import com.pearadmin.pro.modules.sys.domain.SysConfig;
import com.pearadmin.pro.modules.sys.param.SysConfigRequest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@Api(tags = {"课程表"})
@RestController
@RequestMapping(ControllerConstant.PREFIX_SYS + "csc")
public class ClassScheduleController extends BaseController {

    @Resource
    private ClassScheduleService classScheduleService;
    @Resource
    private UserContext userContext;


    @GetMapping("getOneList")
    @Log(title = "获取个人课程表")
    @ApiOperation(value = "配置列表")
    public Result getOneList(){
        String userId = userContext.getUserId();
        return success(classScheduleService.getOneList(userId));
    }
    @PutMapping("edit")
    @Log(title = "修改课程表")
    @ApiOperation(value = "修改课程表")
    public Result edit(@RequestBody ClassSchedule classSchedule) {
        return auto(classScheduleService.updateById(classSchedule));
    }


}
